package cn.xyhelp.shop.user.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author violetfreesia
 * @since 2022-02-12
 */
@Data
public abstract class BaseEntity {

    @JsonIgnore
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @JsonIgnore
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @JsonIgnore
    @TableField("deleted")
    private Integer deleted;

    /**
     * 获取实体主键
     *
     * @return 实体主键
     */
    public abstract Number getId();
}
